<?php
/**
 * 回复处理
 * 
 * @package ews
 * @ews Enterprise WorkShop
 * @version 1.0 alpha
 * @since 2011-05-03
 * @author monkee
 */


class replyApp extends app
{
	public function create(){
		$post = & $this->getData('post');
		$type = intval($post['type']);
		$relate_id = intval($post['relate_id']);
		$replyid = intval($post['replyid']);
		$message = $post['message'];
		
		$replyobj = & $this->getModel('reply');
		$id = $replyobj->create($this->user_id, $this->user['username'], $type, $relate_id, $replyid, $message);
		
		$notice = & $this->getModel('notice');
		$word = $notice->notice_data($type, $relate_id, $replyid>0);
		$notice->create($word['user_id'], $type, '<a href="javascript:;">'.$this->user['username'].'</a> '.$word['message']);
		
		return array('code' => '1');
	}
}
?>